package com.motorola.dp.jenkinsmonitor.model.entity;

import java.util.List;

import com.motorola.dp.jenkinsmonitor.model.util.dom.DomChildren;
import com.motorola.dp.jenkinsmonitor.model.util.dom.DomEntity;

@DomEntity(name = "Hudson")
public class JenkinsState {

    @DomChildren
    private List<JenkinsJob> jobs;

    public List<JenkinsJob> getJobs() {
        return jobs;
    }

    public void setJobs(List<JenkinsJob> jobs) {
        this.jobs = jobs;
    }

    @Override
    public String toString() {
        Integer jobsTotal = 0;
        if (jobs != null) {
            jobsTotal = jobs.size();
        }
        return "JenkinsState [jobs total: " + jobsTotal + "]";
    }


}
